home *** CD-ROM | disk | FTP | other *** search
/ MacFormat UK 160 - Disc 1 / MF_UK_160_1.iso / pc / DiscContent / FullSoftware / Amapi61MacEn / Amapi 3D 6.1 Installer / 3SPACE / HideBehavior.js < prev    next >
Encoding:
Text File  |  2001-02-27  |  863 b   |  47 lines  |  [AMAS/AMAP]

  1. // -* HideBehavior.js *-
  2. //
  3. // Name: Hide behavior
  4. // Description: 
  5. // Author:
  6. // Version: $Id: HideBehavior.js,v 1.3 2001/02/27 11:43:00 consumer Exp $
  7. //
  8.  
  9. function HideBehavior()
  10. {
  11.   // No need for an object with this behavior.
  12. }
  13.  
  14. function HideBehaviorStart(solidName, geom)
  15. {
  16.   // Member variables of the behavior
  17.   this.solidName = solidName;
  18.   this.geom = geom;
  19.   
  20.   TSUpdateNodeAttribute(geom, 'visible', '0');
  21. }
  22.  
  23. function HideBehaviorStop()
  24. {
  25.   TSUpdateNodeAttribute(this.geom, 'visible', '1');
  26. }
  27.  
  28. //
  29. // Event functions
  30. //
  31.  
  32. function HideBehaviorStartEvent(obj, event)
  33. {
  34.   var geom = TSGetExtraParam(event, 'geom');
  35.   var targetSolid = TSGetExtraParam(event, 'targetSolid');
  36.  
  37.   if (targetSolid == "")
  38.     HideBehaviorStart(obj, geom);
  39.   else
  40.     HideBehaviorStart(targetSolid, geom);
  41. }
  42.  
  43. function HideBehaviorStopEvent(obj, event)
  44. {
  45.   HideBehaviorStop() ;
  46. }
  47.